#include "Animal.h"

namespace Hunger
{
	Animal::Animal() : Food(), sex(2), age(0), life(100), hunger(0),
							   speed(50), strength(50), affinity(50), intelligence(50)
	{
	}

	Animal::~Animal()
	{
	}

	void Animal::Eat(Food * food)
	{
		int sustinence = food->Consume();
		life += sustinence;
		if(life > 100)
		{
			life = 100;
		}
	}

	bool Animal::IsFood()
	{
		if(life <= 0 && this->GetNourishment() >= 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	bool Animal::IsDead()
	{
		if(life <= 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	void Animal::Injure(int amount)
	{
		life -= amount;
	}
}
